/***************************************************************************
 *   Copyleft 2008-2009 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __VGLSOFTWAREVERTEXBUFFER_H__
#define __VGLSOFTWAREVERTEXBUFFER_H__

#include "./vVertexBuffer.h"
#include "../../Macros/vMemoryMacros.h"


namespace Vendetta {
	/*! \class vGlVertexBuffer
	 *
	 *  \brief This is an concrete class that provides an implementation of software vertex buffer in OpenGL.
	 *
	 */
	class vGlSoftwareVertexBuffer: public vVertexBuffer {
		friend class vVertexBufferManager;
		friend class vGlVertexBufferManager;
	public:
		/*! \brief Implementation from vVertexBuffer.      
		 *    
		 */
		vVoid Use();
	    
	protected:
		/*! \brief Implementation from vVertexBuffer.      
		 *    
		 */
		vBool build();

		/*! \brief Default constructor.      
		 *    
		 */
		vGlSoftwareVertexBuffer(vUInt uiSize, vUInt32 ui32Format = VVBF_XYZ, 
			eVertexBufferPrimitiveType ePrimitiveType = VVBPT_TRIANGLES,
			eVertexBufferUsage eUsage = VVBU_DYNAMIC);

		/*! \brief Destructor.      
		 *    
		 */
		virtual ~vGlSoftwareVertexBuffer();

	private:
		//! Disabled - if You call this You get exception.
		vGlSoftwareVertexBuffer();
		
		//! Disabled - if You call this You get exception.
		vGlSoftwareVertexBuffer(const vGlSoftwareVertexBuffer& oGlVertexBuffer);

		//! Disabled - if You call this You get exception.
		vGlSoftwareVertexBuffer& operator=(const vGlSoftwareVertexBuffer& oGlVertexBuffer);

	private: 
		vUInt mBufferID;
	};
}
#endif // __VGLSOFTWAREVERTEXBUFFER_H__